package com.baozhun.mall.common.model.bean

import androidx.annotation.Keep
import com.baozhun.mall.common.model.enums.Sex
import java.io.Serializable

/**
 * 作者　: hegaojian
 * 时间　: 2019/12/23
 * 描述　: 账户信息
 */
@Keep
class UserInfo : Serializable {
    var id: String = ""
    var surname: String = "" //姓
    var photo: String? = null
    var score: String = "0.00" //可用余额
    var all_points: String = "0.00" //所有余额
    var birthday: String = ""
    var sex: Int = Sex.MAN.tag
    var city: String = ""
    var county: String = ""
    var address: String = ""
    var level: Int = 0
    var email: String = ""
        get() {
            return if (field == null) "" else field
        }
    var mobile: String? = ""
    var nickname: String = ""
    var token: String = ""
    var bar_code: String = "0" //条码
    var customer_no: String = ""
    var member_amount: String = "" //线上消费
    var total_amount: String = "" //总累计消费金额
    var vip_amount: String = "" //好友卡累计金额
    var offline_amount: String = "" //其它消费金额
    var billing_date: String = "" //有效日期
    var update_time: String = "" //更新日期
    var watingpay: Int = 0 //待支付数量
    var watingdeliver: Int = 0 //待发货数量
    var watingreceipt: Int = 0 //待收货数量
    var return_order: Int = 0 //退货数量
    var is_notice: Int = 1 //客服通知1是开启，2是关闭
    var trans_notice: Int = 1 //交易通知1是开启，2是关闭
    var refund_notice: Int = 1 //退款通知1是开启，2是关闭
    var expire_notice: Int = 1 //余额归还预期通知1是开启，2是关闭
    var rebate_notice: Int = 1 //连单返利通知1是开启，2是关闭
    var status: Int = 0 //合约状态 0 无合约 1履约中 2已逾期 3已达成
    var remark: String = ""//首页合约状态描述
    var remark_m: String = ""//个人中心合约状态描述
    var tb_auth_success: Boolean? = false//淘宝授权状态
    var credit_success: Boolean? = false//授信是否成功
    var tb_authorize_url: String? = ""//淘宝授权链接
    var pdd_auth_success: Boolean? = false//拼多多授权状态
    var show_continue_tips: Boolean? = false//是否显示商品详情连单弹框
    var is_register: Boolean? = false//是否注册
    var pdd_authorize_url: String? = ""//拼多多授权链接

    //余额明细
    var available_points: String = ""//可用积分
    var pending_points: String? = "0" //待到账余额
    var frozen_points: String? = "0" //点击待到账余额
    var expire_points: String? = "0" //今年年底过期余额
    var points: String? = "0" //获得积分
    var order_num: String? = "0" //有效订单数
    var ticket: String? = "0" //有效订单数

    var balance_remark_status: Int = 0 //是否阅读过积分使用条款，0代表未读，1已读

    fun getSexDesc(): String {
        return if (sex == Sex.MAN.tag) Sex.MAN.sexDesc else Sex.WOMEN.sexDesc
    }

    /**
     * 是否显示年底过期余额
     */
    fun showExpirePoints(): Boolean {
        return expire_points != null && expire_points != "0.00" && expire_points != "0"
    }

    fun getAllIntegralStr(): String {
        return if (all_points == null) "" else all_points
    }
}
